package com.flejay.dreamrecruiter.pojo;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Bag Class which contains a list of whatever you wants
 * Warning ! Objects are passed by adress
 * 
 * @author Victor Fleurant
 *
 */
public final class Bag {

	private Bag(){
		super();
	}
	
	private List<Object> contentBag = new ArrayList<Object>();
	
	public static Bag getNewInstance(List<Object> content){
		Bag bag = new Bag();
		bag.getContentBag().addAll(content);
		return bag;
	}
	
	public static Bag getNewInstance(Object[] content){
		Bag bag = new Bag();
		for(Object o : content){
			bag.getContentBag().add(o);
		}
		return bag;
	}
	
	public List<Object> getContentBag() {
		return contentBag;
	}

	@Override
	public String toString(){
		return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}
	
	
}
